package com.kernel;

/****************************************
 * @name Student
 * @description 学生类
 * @author 黄彬恒
 * @since 2018/7/11
 ***************************************/

public class Student {

    //**********成员变量*************//
    public String name;
    protected int age;
    char sex;
    private String phoneNum;

    //**************成员方法***************//
    public void show1(String s) {
        System.out.println("调用了：公有的，String参数的show1(): s = " + s);
    }

    public void show() {
        System.out.println("is show()");
    }

    protected void show2() {
        System.out.println("调用了：受保护的，无参的show2()");
    }

    void show3() {
        System.out.println("调用了：默认的，无参的show3()");
    }

    private String show4(int age) {
        System.out.println("调用了，私有的，并且有返回值的，int参数的show4(): age = " + age);
        return "abcd";
    }

    Student(String string) {
        System.out.println("有参的构造方法 s = " + string);
    }

    /*默认的构造方法*/
    public Student() {
        System.out.println("调用了公有、无参构造方法。。。");
    }

    /*有一个参数的构造方法*/
    public Student(char name) {
        System.out.println("姓名:" + name);
    }

    public Student(String name, int age) {
        System.out.println("姓名:" + name + "年龄:" + age);
    }

    protected Student(boolean n) {
        System.out.println("受保护的构造方法 n= " + n);
    }

    private Student(int age) {
        System.out.println("私有的构造方法 年龄：" + age);
    }

    @Override
    public String toString() {
        return "Student [name=" + name + ", age=" + age + ", sex=" + sex
                + ", phoneNum=" + phoneNum + "]";
    }

    public static void main(String[] args) {
        for (String arg : args) {
            System.out.println(arg);
        }
        System.out.println("main方法执行了。。。");
    }
}


